package com.xxx.utils;

import com.xxx.aspect.Result;

public class ResultUtil {
	
	 /**成功返回 */
	public static Result<Object> success(Object object) {
		Result<Object> result = new Result<Object>();
		result.setCode(0);
		result.setMsg("成功");
		result.setData(object);
		return result;
	}
	/**无参成功返回 */
	public static Result<Object> success() throws Exception{
		return success(null);
	}
	/**错误返回 */
	public static Result<Object> error(Integer code,String msg) {
		Result<Object> result = new Result<Object>();
		result.setCode(code);
		result.setMsg(msg);
		return result;
	}
}
